-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix very strange bug with form_for and capture_html (double render) #1177
Conversation
In the RenderDemo app test the block is rendered 4 times instead of 1. With my patch 2 times. |
👍 The same issue with mine. |
I'm fixing it now. It almost works. |
Yeah, thanks a lot! 💯 |
Okay, here's the summary: haml does not suffer from lacking any of these commits (1 capture in tests) slim suffers from both. It doubles the number of captures in erb suffers only from I still don't understand why
saves slim and erb. The only idea I have is some kind of runtime optimization. |
Merged your changes in a squash commit, thanks for getting this working! I think I can close this now |
* upstream/master: have plugin generator respect root option Fix very strange bug with form_for and capture_html @ujifgc padrino#1177 [padrino-core/rake] Adds lib as a load_path for rake tasks padrino#1185 [form_helpers] Use count instead of size (Closes padrino#1184) [format_helpers] Mark escaped text as html_safe (Closes padrino#1183) Closes padrino#1179 for accidental appended extensions for js urls format activerecord migrate formatting activerecord migration test Thanks to @kenkeiter for bringing up the fact that http_router [is missing PATCH](https://github.com/joshbuddy/http_router/blob/master/lib/http_router/route.rb#L5).
Here's some code that fails very strangely on padrino edge:
https://github.com/ujifgc/tiny
It's basically a test if a block provided for
form_for
executed twice:If you visit the app with padrino edge, log shows double CAPTURE.
If you appy my patch, then it's only one CAPTURE.
The bug is very strange and I fail to write any test that would catch it. Also I don't understand how
differs from
Please help me with test and maybe explanation of the patch effect.